package com.web_bloks.types.client;

/**
 * IPropertyContainer interface
 * 
 * @author Jean-Lou Dupont
 *
 */
public interface IPropertyContainer {
	
	/**
	 * Gets the specified property value by key
	 *  
	 * @param key
	 * @return value
	 * @throws IPropertyException
	 */
	public Property getProperty(String key) throws IPropertyException;
	
	
	/**
	 * Gets the specified property value by key
	 * if it exists or else return the default
	 * 
	 * @param key
	 * @param default
	 * @return value
	 */
	public Property getProperty(String key, Property defaultValue);
	
	/**
	 * Gets the specified property value by key
	 * if it exists or else return the default.
	 * The class of the property value is also checked.
	 * 
	 * @param key
	 * @param defaultValue
	 * @param klass
	 * @return value
	 * @throws IPropertyException
	 */
	@SuppressWarnings("unchecked")
	public Property getProperty(String key, Property defaultValue, Class klass) throws IPropertyException;

	/**
	 * Sets the specified property value by key
	 * 
	 * @param prop
	 * @throws IPropertyException
	 */
	public void setProperty(Property prop) throws IPropertyException;
	

	/**
	 * Verifies if the specified property referenced by key exists
	 * 
	 * @param key String
	 * @return result boolean
	 */
	public boolean hasKey(String key);
	
	/**
	 * Remove a property referenced by key
	 * 
	 * @param key
	 * @return value
	 * @throws IPropertyException if key does not exists
	 */
	public Property removeKey(String key) throws IPropertyException;
	
	
}//